package com.bxl.netty.rpc.common.bean;

/**
 * <>
 *
 * @author baixl
 * @date 2021/2/26
 */
public enum RegisterOperator {
    Register(1, "注册"), Zone(2, "获取Zone"), Zones(2, "所有的Zone"), None(0, "未知操作");
    private int oper;
    private String desc;

    RegisterOperator(int oper, String desc) {
        this.oper = oper;
        this.desc = desc;
    }

    public static RegisterOperator getOperator(int oper) {
        for (RegisterOperator registerOperator : values()) {
            if (registerOperator.getOper() == oper) {
                return registerOperator;
            }
        }

        return RegisterOperator.None;
    }

    public int getOper() {
        return oper;
    }

    public void setOper(int oper) {
        this.oper = oper;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
